package com.lzw.service.impl.student;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.lzw.mapper.student.SAM;
import com.lzw.pojo.Announcement;
import com.lzw.service.student.SAS;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.util.List;

@Service
public class SASI implements SAS {

    @Autowired
    private SAM sam;

    @Override
    public List<Announcement> list(Integer pageNum, Integer pageSize, LocalDate dataPosted) {
        PageHelper.startPage(pageNum,pageSize);
        List<Announcement> list = sam.list(dataPosted);
        Page<Announcement> announcements = (Page<Announcement>) list;
        return announcements;
    }
}
